﻿@page "/demo"
@inherits BasePage
@attribute [Menu(AppConstant.Demo, "全屏首页", "home", 1)]

<PageTitle>Home</PageTitle>

<div class="kui-card" style="padding:10px">
    <KFullScreen ShowIconName OnFullScreen="OnFullScreen">
        <h1 style="font-size:2rem;font-weight:bold">Hello, world!</h1>

        Welcome to your new app.

        <KPdfView Id="pdfView" Path="/Files/5_新版报关委托书.pdf" Style="height:400px" Option="new { ForceIframe = true }" />

        <div style="height:20px;"></div>

        <KGroupBox Title="权限按钮">
            <KButton AuthId="@nameof(New)" Name="新增" OnClick="New" />
            <KButton AuthId="@nameof(Edit)" Name="编辑" />
            <KButton AuthId="@nameof(TestItem)" Name="TestItem" />
            <KButton Name="无权限控制" />
        </KGroupBox>
    </KFullScreen>
</div>

@code {
    [Action]
    public void New()
    {
        var model = new DialogModel
        {
            Title = "新增",
            Style = "width:50vw"
        };
        UI.ShowDialog(model);
    }

    [Action] public void Edit() { }
    [Action] public void TestItem() { }

    private Task OnFullScreen()
    {
        return UI.NoticeAsync("全屏", "全屏打开");
    }
}